<template>
  <div class="flex justify-center">
    <div class="text-center">
      <img :src="noPermission" alt="" width="350" />
      <div class="text-14px text-[var(--el-color-info)]">抱歉，您无权访问权限。</div>
      <div class="mt-20px">
        <ElButton type="primary" @click="loginOut">返回登陆</ElButton>
      </div>
    </div>
  </div>
</template>

<script lang="ts" name="Error" setup>
  import { removeTenantId } from '@/utils/auth'
  import noPermission from '@/assets/svgs/403.svg'
  import { useUserStore } from '@/store/modules/user'
  import { useTagsViewStore } from '@/store/modules/tagsView'

  const userStore = useUserStore()
  const { replace } = useRouter()
  const tagsViewStore = useTagsViewStore()

  const loginOut = async () => {
    await userStore.loginOut()
    tagsViewStore.delAllViews()
    replace('/login')
  }
</script>
